package cn.tedu.spring.life;

public class User {
    private String username;

    public User() {
        System.out.println("1-bean对象实例化,调用无参数构造");
    }

    public void initMethod(){
        System.out.println("3-bean对象初始化,调用指定的初始化方法");
    }
    public void destoryMethod(){
        System.out.println("5-bean对象销毁,调用指定的销毁方法");
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                '}';
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
        System.out.println("2-bean通过set方法给bean对象属性赋值");
    }
}
